package com.yumhai.system.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yumhai.system.service.VersionManageService;
import com.yunhai.common.dto.PaginationVo;
import com.yunhai.common.dto.Ret;
import com.yunhai.model.entity.sys.VersionInfo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/systems")
public class VersionManageController {

    @Resource
    private VersionManageService versionManageService;

    @PostMapping("/version")
    public Ret addVersionInfo(@RequestBody VersionInfo versionInfo) throws Exception {

        versionManageService.addVersionInfo(versionInfo);
        return Ret.ok();
    }

    @GetMapping("/version/pagination")
    public Ret getVersionPagination(PaginationVo paginationVo) throws Exception {

        IPage page = versionManageService.getVersionPagination(paginationVo);
        return Ret.toPage(page);
    }

}
